using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class sms_recordMap : EntityTypeConfiguration<sms_record>
    {
        public sms_recordMap()
        {
            // Primary Key
            this.HasKey(t => t.sms_id);

            // Properties
            this.Property(t => t.sms_target_person)
                .HasMaxLength(20);

            this.Property(t => t.sms_target_mobile)
                .HasMaxLength(20);

            this.Property(t => t.sms_content)
                .HasMaxLength(200);

            this.Property(t => t.user_id)
                .HasMaxLength(20);

            this.Property(t => t.sms_process_status)
                .HasMaxLength(10);

            this.Property(t => t.sms_status_desc)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("sms_record");
            this.Property(t => t.sms_id).HasColumnName("sms_id");
            this.Property(t => t.sms_time).HasColumnName("sms_time");
            this.Property(t => t.sms_target_person).HasColumnName("sms_target_person");
            this.Property(t => t.sms_target_mobile).HasColumnName("sms_target_mobile");
            this.Property(t => t.sms_content).HasColumnName("sms_content");
            this.Property(t => t.user_id).HasColumnName("user_id");
            this.Property(t => t.sms_process_status).HasColumnName("sms_process_status");
            this.Property(t => t.sms_status_desc).HasColumnName("sms_status_desc");
        }
    }
}
